import React, { Component } from 'react'
import { Link, Route } from 'react-router-dom'
import Home from './components/Home'
import About from './components/About'

export default class App extends Component {
  render() {
    return (
      <div className="container">
        <h1>React Router Demo</h1>
        <div className="d-flex align-items-start">
          <div className="nav flex-column nav-pills me-3">
            <Link className="nav-link" to="/Home">
              Home
            </Link>
            <Link className="nav-link" to="/About">
              About
            </Link>
          </div>
          <div className="tab-content">
            {/* 注册路由 */}
            <Route path="/Home" component={Home} />
            <Route path="/About" component={About} />
          </div>
        </div>
      </div>
    )
  }
}
